home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / urt / amiga_extras / getami / plot.asm < prev    next >
Encoding:
Assembly Source File  |  1993-12-22  |  1.3 KB  |  94 lines

  1. ;    This code is a modified version of the plot routine in
  2. ;    Thomas Landspurg's ``SuperDark'' modular screen blanker,
  3. ;    adapted to draw on windows, rather than screens.
  4.  
  5.     csect    text,0,0,1,2
  6.  
  7.     include    "intuition/intuition.i"
  8.     include    "graphics/rastport.i"
  9.     include    "graphics/gfx.i"
  10.  
  11.     xdef    _MultiPlot
  12.  
  13. YES    SET    0    ; So that IFEQ YES assembles the conditional code
  14. NO    SET    1
  15.  
  16. ORIG    SET    NO    ; Do not use the original, Screen version
  17. FAST    SET    YES    ; Do not draw color 0, saving a bit more time
  18.  
  19. _MultiPlot:
  20.     IFEQ    FAST
  21.     tst.w    d2
  22.     beq.b    quit
  23.     ENDC
  24.  
  25.     IFEQ    ORIG
  26.     cmp.w    sc_Width(a0),d0
  27.     ENDC
  28.     IFNE    ORIG
  29.     cmp.w    wd_Width(a0),d0
  30.     ENDC
  31.     bcc    quit
  32.  
  33.     IFEQ    ORIG
  34.     cmp.w    sc_Height(a0),d1
  35.     ENDC
  36.     IFNE    ORIG
  37.     cmp.w    wd_Height(a0),d1
  38.     ENDC
  39.     bcc    quit
  40.  
  41.     movem.l    d3/d4,-(sp)
  42.  
  43.     IFEQ    ORIG
  44.     move.l    sc_RastPort+rp_BitMap(a0),a0
  45.     ENDC
  46.     IFNE    ORIG
  47.     move.l  wd_RPort(a0),a0
  48.     move.l    rp_BitMap(a0),a0
  49.     ENDC
  50.     moveq    #0,d4
  51.     moveq    #0,d3
  52.     move.w    bm_BytesPerRow(a0),d4
  53.     move.b    bm_Depth(a0),d3
  54.     lea.l    bm_Planes(a0),a0
  55.  
  56.     mulu    d4,d1
  57.     move.l    d0,d4
  58.     lsr    #3,d0
  59.     add    d0,d1
  60.     not    d4
  61.     subq    #1,d3
  62.  
  63. loop    move.l    (a0)+,a1
  64.     lsr.b    #1,d2
  65.     bcc    clear
  66.     bset    d4,0(a1,d1.l)
  67.     dbra    d3,loop
  68.  
  69. exit    movem.l    (sp)+,d3/d4
  70. quit    rts
  71.  
  72. clear    bclr    d4,0(a1,d1.l)
  73.     dbra    d3,loop
  74.     bra    exit
  75.  
  76.     IFEQ    ORIG
  77.     xdef    _MonoPlot
  78.  
  79. _MonoPlot:
  80.     cmp.w    d3,d0
  81.     bcc    1$
  82.     cmp.w    d4,d1
  83.     bcc    1$
  84.     mulu    d2,d1
  85.     move    d0,d2
  86.     lsr    #3,d0
  87.     add    d0,d1
  88.     not    d2
  89.     bset    d2,0(a0,d1)
  90. 1$    rts
  91.     ENDC
  92.  
  93.     end
  94.